From: Colin Walters Date: Mon, 29 Aug 2016 15:03:35 +0000 (-0400) Subject: commit: Don't delete tmp/cache dir X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~48^2~6 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a269075724dda958bb66e19f0d4ec3f5e52d97ba;p=ostree.git commit: Don't delete tmp/cache dir We hold a fd open on this, and it's basically now expected to be immortal. Confer that status. This was showing up in flatpak crashers, because we'd get an unexpected errno. (I didn't test this fixes the crasher, but it's clearly right) https://bugzilla.redhat.com/show_bug.cgi?id=1347293 Closes: #476 Approved by: alexlarsson --- diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 9a938ddc..8dfe276f 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -1219,6 +1219,12 @@ cleanup_tmpdir (OstreeRepo *self, if (dent == NULL) break; + /* Special case this; we create it when opening, and don't want + * to blow it away. + */ + if (strcmp (dent->d_name, "cache") == 0) + continue; + if (TEMP_FAILURE_RETRY (fstatat (dfd_iter.fd, dent->d_name, &stbuf, AT_SYMLINK_NOFOLLOW)) < 0) { if (errno == ENOENT) /* Did another cleanup win? */